package br.com.localfloripa.entities;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="ramo")
public class Ramo implements Serializable {
	
	private static final long serialVersionUID = -4102205480293932353L;
	
	@SequenceGenerator(name="Ramo_Seq",sequenceName="ramo_seq")
	@Id @GeneratedValue(generator="Ramo_Seq")
	private Long id;
	@Column(name="nome",nullable=false, length=60)
	private String nome;
	@Column(name="descricao",nullable=true,length=255)
	private String descricao;
	@Column(name="ativo",nullable=false)
	private Boolean ativo;
	
	public Ramo() {
		
	}
	@PrePersist
	private void prePersist(){
		this.ativo = true;
	}
	public Ramo(Long id, String nome) {
		this.id = id;
		this.nome = nome;
	}
	public String getNome() {
		return nome;
	}
	public void setNome(String nome) {
		this.nome = nome;
	}
	public String getDescricao() {
		return descricao;
	}
	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public Boolean getAtivo() {
		return ativo;
	}
	public void setAtivo(Boolean ativo) {
		this.ativo = ativo;
	}	

}
